set -ex
if [! -n "$1" ]; then
	VER=`gittag | grep -v "v" | tail -n 1 | python3 -c "import sys;vers=sys.stdin.readline().strip().split('.');print('.'.join([*vers[:2],str(int(vers[2])+1)]))"`
else
	VER="$1"
fi
git tag $VER
git push -u origin ${VER}
docker build -t crpi-xqcmt7i0l3a9xns5.cn-guangzhou.personal.cr.aliyuncs.com/haoyouxiaoju/demo_fe:$VER .
docker push crpi-xqcmt7i0l3a9xns5.cn-guangzhou.personal.cr.aliyuncs.com/haoyouxiaoju/demo_fe:$VER
echo crpi-xqcmt7i0l3a9xns5.cn-guangzhou.personal.cr.aliyuncs.com/haoyouxiaoju/demo_fe:$VER
